<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Reranker Framework (ReFr): reranker::Factory&lt; T &gt; Class Template Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Reranker Framework (ReFr)
   
   </div>
   <div id="projectbrief">Reranking framework for structure prediction and discriminative language modeling</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespacereranker.html">reranker</a>      </li>
      <li class="navelem"><a class="el" href="classreranker_1_1_factory.html">Factory</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">reranker::Factory&lt; T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="reranker::Factory" --><!-- doxytag: inherits="reranker::FactoryBase" -->
<p><a class="el" href="classreranker_1_1_factory.html" title="Factory for dynamically created instance of the specified type.">Factory</a> for dynamically created instance of the specified type.  
 <a href="classreranker_1_1_factory.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="factory_8_h_source.html">factory.H</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for reranker::Factory&lt; T &gt;:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classreranker_1_1_factory.png" usemap="#reranker::Factory&lt; T &gt;_map" alt=""/>
  <map id="reranker::Factory&lt; T &gt;_map" name="reranker::Factory&lt; T &gt;_map">
<area href="classreranker_1_1_factory_base.html" title="An interface for all Factory instances, specifying a few pure virtual methods." alt="reranker::FactoryBase" shape="rect" coords="0,0,142,24"/>
</map>
 </div></div>

<p><a href="classreranker_1_1_factory-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#ad22223cf69fd67cff3bfc6dec46ddbdd">Factory</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a new factory.  <a href="#ad22223cf69fd67cff3bfc6dec46ddbdd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a555f8107c0c4866c5a00f9c8d3073ef2">Clear</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears this factory of all (possibly static) data.  <a href="#a555f8107c0c4866c5a00f9c8d3073ef2"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">shared_ptr&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a68117013334b03c94fc525e62080311f">CreateOrDie</a> (<a class="el" href="classreranker_1_1_stream_tokenizer.html">StreamTokenizer</a> &amp;st, <a class="el" href="classreranker_1_1_environment.html">Environment</a> *env=NULL)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Dynamically creates an object, whose type and initialization are contained in a specification string, the tokens of which are given by the specified <a class="el" href="classreranker_1_1_stream_tokenizer.html">StreamTokenizer</a>.  <a href="#a68117013334b03c94fc525e62080311f"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">shared_ptr&lt; T &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a6f4d2f54c4530cb070b90baa4877640a">CreateOrDie</a> (const string &amp;spec, const string err_msg, <a class="el" href="classreranker_1_1_environment.html">Environment</a> *env=NULL)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual const string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a497687eed621332ca0b9883acc60ce82">BaseName</a> () const </td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name of the base type of objects constructed by this factory.  <a href="#a497687eed621332ca0b9883acc60ce82"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a1805fa630698b85e498cb707f81cb554">CollectRegistered</a> (unordered_set&lt; string &gt; &amp;registered) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classreranker_1_1_var_map_base.html">VarMapBase</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#ad4254b84185e3c479811ee9c68cb28c7">CreateVarMap</a> (<a class="el" href="classreranker_1_1_environment.html">Environment</a> *env) const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual <a class="el" href="classreranker_1_1_var_map_base.html">VarMapBase</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#add485d5ad36809087244990d01542336">CreateVectorVarMap</a> (<a class="el" href="classreranker_1_1_environment.html">Environment</a> *env) const </td></tr>
<tr><td colspan="2"><h2><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a5d150fb6e621783b7d71e8dac8f145cd">IsRegistered</a> (const string &amp;type)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the specified type has been registered with this factory (where registration happens typically via the <a class="el" href="factory_8_h.html#a0b09e4aaef613d7556c07875c7d5a029">REGISTER_NAMED</a> macro).  <a href="#a5d150fb6e621783b7d71e8dac8f145cd"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="classreranker_1_1_constructor.html">Constructor</a>&lt; T &gt; *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a91816c7ee7c55db9b20036a602d63511">Register</a> (const string &amp;type, const <a class="el" href="classreranker_1_1_constructor.html">Constructor</a>&lt; T &gt; *p)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The method used by the <a class="el" href="factory_8_h.html#a0b09e4aaef613d7556c07875c7d5a029">REGISTER_NAMED</a> macro to ensure that subclasses add themselves to the factory.  <a href="#a91816c7ee7c55db9b20036a602d63511"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classreranker_1_1_factory.html#a892eeb8c39013c68c4082c2247d1cbf3">ClearStatic</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Clears all static data associated with this class.  <a href="#a892eeb8c39013c68c4082c2247d1cbf3"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename T&gt;<br/>
class reranker::Factory&lt; T &gt;</h3>

<p><a class="el" href="classreranker_1_1_factory.html" title="Factory for dynamically created instance of the specified type.">Factory</a> for dynamically created instance of the specified type. </p>
<dl class=""><dt><b>Template Parameters:</b></dt><dd>
  <table class="">
    <tr><td class="paramname">T</td><td>the type of objects created by this factory, required to have a method with the signature <code>Init(const string &amp;arg)</code> </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00299">299</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ad22223cf69fd67cff3bfc6dec46ddbdd"></a><!-- doxytag: member="reranker::Factory::Factory" ref="ad22223cf69fd67cff3bfc6dec46ddbdd" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html">Factory</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Constructs a new factory. </p>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00302">302</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a497687eed621332ca0b9883acc60ce82"></a><!-- doxytag: member="reranker::Factory::BaseName" ref="a497687eed621332ca0b9883acc60ce82" args="() const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual const string <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a497687eed621332ca0b9883acc60ce82">BaseName</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns the name of the base type of objects constructed by this factory. </p>

<p>Implements <a class="el" href="classreranker_1_1_factory_base.html#a3f0dd88a8da419dde3cbe3e97fda55ab">reranker::FactoryBase</a>.</p>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00617">617</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="a555f8107c0c4866c5a00f9c8d3073ef2"></a><!-- doxytag: member="reranker::Factory::Clear" ref="a555f8107c0c4866c5a00f9c8d3073ef2" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a555f8107c0c4866c5a00f9c8d3073ef2">Clear</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Clears this factory of all (possibly static) data. </p>
<p><code>Note</code> that invoking this method will prevent the factory from functioning! It should only be invoked when the factory is no longer needed by the current process. </p>

<p>Implements <a class="el" href="classreranker_1_1_factory_base.html#a2b7ed0a748bf9eefbc30355167fe8ad9">reranker::FactoryBase</a>.</p>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00309">309</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="a892eeb8c39013c68c4082c2247d1cbf3"></a><!-- doxytag: member="reranker::Factory::ClearStatic" ref="a892eeb8c39013c68c4082c2247d1cbf3" args="()" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a892eeb8c39013c68c4082c2247d1cbf3">ClearStatic</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Clears all static data associated with this class. </p>
<p><code>Note</code> that invoking this method will prevent the factory from functioning! It should only be invoked when the factory is no longer needed by the current process. </p>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00674">674</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="a1805fa630698b85e498cb707f81cb554"></a><!-- doxytag: member="reranker::Factory::CollectRegistered" ref="a1805fa630698b85e498cb707f81cb554" args="(unordered_set&lt; string &gt; &amp;registered) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual void <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a1805fa630698b85e498cb707f81cb554">CollectRegistered</a> </td>
          <td>(</td>
          <td class="paramtype">unordered_set&lt; string &gt; &amp;&#160;</td>
          <td class="paramname"><em>registered</em></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Collects the names of types registered with this factory. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">registered</td><td>registered a set to be modified by this method so that it contains the names of concrete types registered with this factory </td></tr>
  </table>
  </dd>
</dl>
 
<p>Implements <a class="el" href="classreranker_1_1_factory_base.html#ada8c5df4396bb4e785b690d0a6d5922f">reranker::FactoryBase</a>.</p>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00631">631</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="a68117013334b03c94fc525e62080311f"></a><!-- doxytag: member="reranker::Factory::CreateOrDie" ref="a68117013334b03c94fc525e62080311f" args="(StreamTokenizer &amp;st, Environment *env=NULL)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">shared_ptr&lt;T&gt; <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a68117013334b03c94fc525e62080311f">CreateOrDie</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_stream_tokenizer.html">StreamTokenizer</a> &amp;&#160;</td>
          <td class="paramname"><em>st</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_environment.html">Environment</a> *&#160;</td>
          <td class="paramname"><em>env</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Dynamically creates an object, whose type and initialization are contained in a specification string, the tokens of which are given by the specified <a class="el" href="classreranker_1_1_stream_tokenizer.html">StreamTokenizer</a>. </p>
<p>A specification string has the form </p>
<div class="fragment"><pre class="fragment"> Typename(member1(init1), member2(init2), ...)
</pre></div><p> where the type of a member can be </p>
<ul>
<li>
a primitive (a <code>string</code>, <code>double</code>, <code>int</code> or <code>bool</code>), </li>
<li>
a <a class="el" href="classreranker_1_1_factory.html">Factory</a>-constructible type, </li>
<li>
a vector of primtives or </li>
<li>
a vector of types constructible by the same <a class="el" href="classreranker_1_1_factory.html" title="Factory for dynamically created instance of the specified type.">Factory</a>. </li>
</ul>
<p>In the case of members that are vectors, the init string can be a comma-separated list of of initializers for its elements. For example, the class <a class="el" href="classreranker_1_1_example_feature_extractor.html" title="This class illustrates how to write a FeatureExtractor implementation.">ExampleFeatureExtractor</a> class has three members that are registered to be initialized by <a class="el" href="classreranker_1_1_factory.html">Factory</a>&lt;<a class="el" href="classreranker_1_1_feature_extractor.html">FeatureExtractor</a>&gt; (via the <a class="el" href="classreranker_1_1_example_feature_extractor.html#a53c0cf9f66922b417d08f42a816cdd35">ExampleFeatureExtractor::RegisterInitializers</a> method): </p>
<ul>
<li>
a member named <code>arg</code> of type <code>string</code>, </li>
<li>
a member named <code>strvec</code> of type <code>vector&lt;string&gt;</code> and </li>
<li>
a member named <code>b</code> of type <code>bool</code>. </li>
</ul>
<p>None of these is a &ldquo;required&rdquo; member, meaning they act like optional arguments to a constructor. The following are all legal specification strings for constructing instances of <a class="el" href="classreranker_1_1_example_feature_extractor.html" title="This class illustrates how to write a FeatureExtractor implementation.">ExampleFeatureExtractor</a>: </p>
<div class="fragment"><pre class="fragment"> ExampleFeatureExtractor(arg(<span class="stringliteral">&quot;foo&quot;</span>), strvec({<span class="stringliteral">&quot;foo&quot;</span>, <span class="stringliteral">&quot;bar&quot;</span>, <span class="stringliteral">&quot;baz&quot;</span>}), b(<span class="keyword">true</span>))
 ExampleFeatureExtractor(strvec({<span class="stringliteral">&quot;foo&quot;</span>, <span class="stringliteral">&quot;bar&quot;</span>, <span class="stringliteral">&quot;baz&quot;</span>,}))
 ExampleFeatureExtractor(b(false))
 ExampleFeatureExtractor()
</pre></div><p> Crucially, note how a vector can have an optional comma at the end of its list (the second example), and how a boolean may be initialized either with one of the two <em>reserved words</em> <code>true</code> or <code>false</code>, as in C and C++. Finally, unlike parameter lists to C++ constructors, since our members are always named, the grammar allows them to appear in any order, making the following two specification strings equivalent: </p>
<div class="fragment"><pre class="fragment"> ExampleFeatureExtractor(arg(<span class="stringliteral">&quot;foo&quot;</span>), strvec({<span class="stringliteral">&quot;foo&quot;</span>, <span class="stringliteral">&quot;bar&quot;</span>, <span class="stringliteral">&quot;baz&quot;</span>}))
 ExampleFeatureExtractor(strvec({<span class="stringliteral">&quot;foo&quot;</span>, <span class="stringliteral">&quot;bar&quot;</span>, <span class="stringliteral">&quot;baz&quot;</span>}), arg(<span class="stringliteral">&quot;foo&quot;</span>))
</pre></div><p>More formally, the specification string must conform to the following grammar: </p>
<table  border="0">
<tr>
<td><code>&lt;spec&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;type&gt; '(' &lt;member_init_list&gt; ')'</code>  </td></tr>
<tr>
<td><code>&lt;type&gt;</code> </td><td><code>::=</code> </td><td>name of type constructible by a <a class="el" href="classreranker_1_1_factory.html" title="Factory for dynamically created instance of the specified type.">Factory</a>  </td></tr>
<tr>
<td><code>&lt;member_init_list&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;member_init&gt; [ ',' &lt;member_init&gt; ]* [',']</code>  </td></tr>
<tr>
<td><code>&lt;member_init&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;primitive_init&gt; | &lt;factory_init&gt; | &lt;primitive_vector_init&gt; | &lt;factory_vector_init&gt; </code>  </td></tr>
<tr>
<td><code>&lt;primitive_init&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;member_name&gt; '(' &lt;literal&gt; ')'</code>  </td></tr>
<tr>
<td><code>&lt;member_name&gt;</code> </td><td><code>::=</code> </td><td>the name of the member to be initialized, as specified by <code>&lt;type&gt;&rsquo;s</code> <code>RegisterInitializers</code> method  </td></tr>
<tr>
<td><code>&lt;literal&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;string_literal&gt; | &lt;double_literal&gt; | &lt;int_literal&gt; | &lt;bool_literal&gt;</code>  </td></tr>
<tr valign="top">
<td><code>&lt;string_literal&gt;</code> </td><td><code>::=</code> </td><td>a C++ string literal (a string of characters surrounded by double quotes); double quotes and backslashes may be escaped inside a string literal with a backslash; other escape sequences, such as <code>\t</code> for the tab character, are currently not recognized  </td></tr>
<tr>
<td><code>&lt;double_literal&gt;</code> </td><td><code>::=</code> </td><td>a string that can be parsed by <code>atof</code>  </td></tr>
<tr>
<td><code>&lt;int_literal&gt;</code> </td><td><code>::=</code> </td><td>a string that can be parsed by <code>atoi</code>  </td></tr>
<tr>
<td><code>&lt;bool_literal&gt;</code> </td><td><code>::=</code> </td><td><code>true | false</code>  </td></tr>
<tr>
<td><code>&lt;primitive_vector_init&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;member_name&gt; '(' '{' &lt;literal_list&gt; '}' ')'</code>  </td></tr>
<tr>
<td valign="top"><code>&lt;literal_list&gt;</code> </td><td valign="top"><code>::=</code> </td><td><code>&lt;string_literal&gt; [ ',' &lt;string_literal&gt; ]* [','] |<br/>
 &lt;double_literal&gt; [ ',' &lt;double_literal&gt; ]* [','] |<br/>
 &lt;int_literal&gt; [ ',' &lt;int_literal&gt; ]* [','] |<br/>
 &lt;bool_literal&gt; [ ',' &lt;bool_literal&gt; ]* [',']</code>   </td></tr>
<tr>
<td><code>&lt;factory_init&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;member_name&gt; '(' &lt;spec&gt; ')'</code>  </td></tr>
<tr>
<td><code>&lt;factory_vector_init&gt;</code> </td><td><code>::=</code> </td><td><code>&lt;member_name&gt; '(' '{' &lt;spec_list&gt; '}' ')'</code>  </td></tr>
<tr>
<td valign="top"><code>&lt;spec_list&gt;</code> </td><td valign="top"><code>::=</code> </td><td><code>&lt;spec&gt; [ ',' &lt;spec&gt; ]* [',']</code><br/>
 where every <code>&lt;spec&gt;</code> has a <code>&lt;type&gt;</code> constructible by the same <a class="el" href="classreranker_1_1_factory.html" title="Factory for dynamically created instance of the specified type.">Factory</a> (<em>i.e.</em>, all <code>&lt;type&gt;</code>&rsquo;s have a common abstract base class)   </td></tr>
</table>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">st</td><td>the stream tokenizer providing tokens according to the grammar shown above </td></tr>
    <tr><td class="paramname">env</td><td>the <a class="el" href="classreranker_1_1_environment.html">Environment </a> in this method was called, or <code>NULL</code> if there is no calling environment </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00465">465</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="a6f4d2f54c4530cb070b90baa4877640a"></a><!-- doxytag: member="reranker::Factory::CreateOrDie" ref="a6f4d2f54c4530cb070b90baa4877640a" args="(const string &amp;spec, const string err_msg, Environment *env=NULL)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">shared_ptr&lt;T&gt; <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a68117013334b03c94fc525e62080311f">CreateOrDie</a> </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>spec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const string&#160;</td>
          <td class="paramname"><em>err_msg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_environment.html">Environment</a> *&#160;</td>
          <td class="paramname"><em>env</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00609">609</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="ad4254b84185e3c479811ee9c68cb28c7"></a><!-- doxytag: member="reranker::Factory::CreateVarMap" ref="ad4254b84185e3c479811ee9c68cb28c7" args="(Environment *env) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classreranker_1_1_var_map_base.html">VarMapBase</a>* <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#ad4254b84185e3c479811ee9c68cb28c7">CreateVarMap</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_environment.html">Environment</a> *&#160;</td>
          <td class="paramname"><em>env</em></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classreranker_1_1_factory_base.html#a165b07587cacb1112b783f5191c51fd5">reranker::FactoryBase</a>.</p>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00642">642</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="add485d5ad36809087244990d01542336"></a><!-- doxytag: member="reranker::Factory::CreateVectorVarMap" ref="add485d5ad36809087244990d01542336" args="(Environment *env) const " -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">virtual <a class="el" href="classreranker_1_1_var_map_base.html">VarMapBase</a>* <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#add485d5ad36809087244990d01542336">CreateVectorVarMap</a> </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classreranker_1_1_environment.html">Environment</a> *&#160;</td>
          <td class="paramname"><em>env</em></td><td>)</td>
          <td> const<code> [inline, virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Implements <a class="el" href="classreranker_1_1_factory_base.html#a8ba4ece87f76449fbdc2702bb6ddcb76">reranker::FactoryBase</a>.</p>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00647">647</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="a5d150fb6e621783b7d71e8dac8f145cd"></a><!-- doxytag: member="reranker::Factory::IsRegistered" ref="a5d150fb6e621783b7d71e8dac8f145cd" args="(const string &amp;type)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static bool <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a5d150fb6e621783b7d71e8dac8f145cd">IsRegistered</a> </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>type</em></td><td>)</td>
          <td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Returns whether the specified type has been registered with this factory (where registration happens typically via the <a class="el" href="factory_8_h.html#a0b09e4aaef613d7556c07875c7d5a029">REGISTER_NAMED</a> macro). </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the type to be tested </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>whether the specified type has been registered with this factory </dd></dl>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00626">626</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<a class="anchor" id="a91816c7ee7c55db9b20036a602d63511"></a><!-- doxytag: member="reranker::Factory::Register" ref="a91816c7ee7c55db9b20036a602d63511" args="(const string &amp;type, const Constructor&lt; T &gt; *p)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T&gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">static const <a class="el" href="classreranker_1_1_constructor.html">Constructor</a>&lt;T&gt;* <a class="el" href="classreranker_1_1_factory.html">reranker::Factory</a>&lt; T &gt;::<a class="el" href="classreranker_1_1_factory.html#a91816c7ee7c55db9b20036a602d63511">Register</a> </td>
          <td>(</td>
          <td class="paramtype">const string &amp;&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classreranker_1_1_constructor.html">Constructor</a>&lt; T &gt; *&#160;</td>
          <td class="paramname"><em>p</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The method used by the <a class="el" href="factory_8_h.html#a0b09e4aaef613d7556c07875c7d5a029">REGISTER_NAMED</a> macro to ensure that subclasses add themselves to the factory. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>the type to be registered </td></tr>
    <tr><td class="paramname">p</td><td>the constructor for the specified type </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="factory_8_h_source.html#l00658">658</a> of file <a class="el" href="factory_8_h_source.html">factory.H</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="factory_8_h_source.html">factory.H</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Apr 9 2013 11:56:30 for Reranker Framework (ReFr) by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
